<?php
/**
 * @version : 1.0
 * @package : lib/form
 * @todo:  Lớp CPaging cơ sở. Xử lý phân trang cho danh sách
*/
class CPaging
{
      public $options;
      function __construct($options)
      {
            $this->options = array_merge(array(
            'current_page' => 1,
            'total_page' => 100,
            'template' => 'lib/form/paging.tpl',
            'paging_name' => 'page',
            'base_url' => CUrl::build_all(array('page')),
            'total_item'=>1,
            'items_per_page'=>10,
            'display_page_count' => 5
            ),$options);
            
            if($this->options['current_page'] > 1 && $this->options['display_page_count'] > 1){
            	$average_count = floor($this->options['display_page_count']/2);
            }
      }
      function draw()
      {
            CForm('lib/form/paging.tpl')->parse($this->options);
      }
}
?>